package com.herench.bs.handler;

import com.herench.bs.annotation.Handler;
import com.herench.bs.support.AbstractMessageHandler;
import com.herench.bs.support.RequestMessage;
import com.herench.bs.support.ResponseMessage;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by ThinkPad on 2018/3/8.
 */
@Component
@Handler(code = "100747" ,name="获取门特类型列表")
public class PayTypeHandler extends AbstractMessageHandler {

    @Override
    protected ResponseMessage innerHandler(RequestMessage requestMessage) throws Exception {
        ResponseMessage responseMessage = new ResponseMessage(requestMessage.getId());
        String channelCode = requestMessage.getArgsPropertyStringValue("sysCode");
        List<Map<String, Object>> resultList = new ArrayList<>();
        if (channelCode.equals("100103")) {

            Map<String, Object> infoMap = new HashMap<>();
            Map<String, Object> parkMap = new HashMap<>();
            resultList.add(infoMap);
            resultList.add(parkMap);
            List<Map<String, Object>> infoList = new ArrayList<>();
            infoMap.put("payType", "12");
            infoMap.put("payTypeName", "Ⅰ类门诊特殊病");
            infoMap.put("insurList", infoList);
            Map<String, Object> subInfoMap1 = new HashMap<>();
            subInfoMap1.put("mtType", "1");
            subInfoMap1.put("mtTypeName", "肾透析");
            Map<String, Object> subInfoMap2 = new HashMap<>();
            subInfoMap2.put("mtType", "2");
            subInfoMap2.put("mtTypeName", "肾移植抗排异");
            Map<String, Object> subInfoMap3 = new HashMap<>();
            subInfoMap3.put("mtType", "3");
            subInfoMap3.put("mtTypeName", "癌症放化疗");
            Map<String, Object> subInfoMap4 = new HashMap<>();
            subInfoMap4.put("mtType", "21");
            subInfoMap4.put("mtTypeName", "血友病");
            Map<String, Object> subInfoMap5 = new HashMap<>();
            subInfoMap5.put("mtType", "22");
            subInfoMap5.put("mtTypeName", "肝移植术后抗排异治疗");
            Map<String, Object> subInfoMap6 = new HashMap<>();
            subInfoMap6.put("mtType", "10");
            subInfoMap6.put("mtTypeName", "再生障碍性贫血");
            Map<String, Object> subInfoMap7 = new HashMap<>();
            subInfoMap7.put("mtType", "11");
            subInfoMap7.put("mtTypeName", "慢性血小板减少性紫癜");
            infoList.add(subInfoMap1);
            infoList.add(subInfoMap2);
            infoList.add(subInfoMap3);
            infoList.add(subInfoMap4);
            infoList.add(subInfoMap5);
            infoList.add(subInfoMap6);
            infoList.add(subInfoMap7);
            List<Map<String, Object>> parkList = new ArrayList<>();
            parkMap.put("payType", "13");
            parkMap.put("payTypeName", "Ⅱ类门诊特殊病");
            parkMap.put("insurList", parkList);
            Map<String, Object> subParkMap1 = new HashMap<>();
            subParkMap1.put("mtType", "4");
            subParkMap1.put("mtTypeName", "糖尿病");
            Map<String, Object> subParkMap2 = new HashMap<>();
            subParkMap2.put("mtType", "5");
            subParkMap2.put("mtTypeName", "肺心病");
            Map<String, Object> subParkMap3 = new HashMap<>();
            subParkMap3.put("mtType", "6");
            subParkMap3.put("mtTypeName", "红斑狼疮");
            Map<String, Object> subParkMap4 = new HashMap<>();
            subParkMap4.put("mtType", "7");
            subParkMap4.put("mtTypeName", "精神病");
            Map<String, Object> subParkMap5 = new HashMap<>();
            subParkMap5.put("mtType", "8");
            subParkMap5.put("mtTypeName", "偏瘫");
            Map<String, Object> subParkMap6 = new HashMap<>();
            subParkMap6.put("mtType", "9");
            subParkMap6.put("mtTypeName", "癫痫");
            parkList.add(subParkMap1);
            parkList.add(subParkMap2);
            parkList.add(subParkMap3);
            parkList.add(subParkMap4);
            parkList.add(subParkMap5);
            parkList.add(subParkMap6);
        }
        responseMessage.setDataAttribute("dataList", resultList);
        responseMessage.setCode("0");
        responseMessage.setMessage("请求成功");
        return responseMessage;
    }
}
